﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WHW_NetUtility
{
    class Log4Helper
    {
        /*log4net使用方法：
         * 1.添加引用（log4net.dll可以放在bin/debug下）
         * 2.添加app.config(有时会自动生成，只需要在此配置文件中添加log4net的配置就可以了)
         * 3.在属性--> AssemblyInfo.cs中添加[assembly:log4net.Config.XmlConfigurator(Watch =true)]
         * 4.调用如下函数
         */
        public static void WriteLog(Type t,Exception ex)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(t);
            log.Error(ex);
        }

        public static void WriteLog(Type t, string msg)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(t);
            log.Info(msg);
        }
    }
}
